<?php

declare(strict_types=1);

namespace App\Music\Model;

use Hyperf\Database\Model\SoftDeletes;
use Mine\MineModel;

/**
 * @property int $id ID
 * @property string $name 歌曲类型名称
 * @property string $img 图片
 * @property int $status 状态:1=正常,2=隐藏
 * @property int $weigh 权重
 * @property \Carbon\Carbon $created_at 创建时间
 * @property \Carbon\Carbon $updated_at 更新时间
 * @property string $deleted_at 删除时间
 */
class MusicSongTag extends MineModel
{
    use SoftDeletes;
    /**
     * The table associated with the model.
     */
    protected ?string $table = 'music_song_tag';

    /**
     * The attributes that are mass assignable.
     */
    protected array $fillable = ['id', 'name', 'img', 'status', 'weigh', 'created_at', 'updated_at', 'deleted_at'];

    /**
     * The attributes that should be cast to native types.
     */
    protected array $casts = ['id' => 'integer', 'status' => 'integer', 'weigh' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];

    /**
     * 歌曲列表
     * */
    public function song()
    {
        return $this->hasMany(MusicSong::class, 'tag_id', 'song_id');
    }

}
